Use designated initialization in DECLARE_RT_SVC macro
authorSoby Mathew <[email protected]>
Tue, 12 Jan 2016 10:28:42 +0000 (10:28 +0000)
committerSoby Mathew <[email protected]>
Wed, 13 Jan 2016 09:39:11 +0000 (09:39 +0000)
This patch changes the anonymous initialization of `rt_svc_desc_t` structure
by the `DECLARE_RT_SVC` macro to designated initialization. This makes the
code more robust and less sensitive to potential changes to the
`rt_svc_desc_t` structure.

Change-Id: If6f1586730c0d29d92ef09e07eff7dd0d22857c7

include/bl31/runtime_svc.h

index 30ba29f045cbc10e72ca2a37ea0069c9ff1ac515..87f2dd2c6d3299264106107efa57b8ab7b35035b 100644 (file)
@@ -89,12 +89,12 @@ typedef struct rt_svc_desc {
 #define DECLARE_RT_SVC(_name, _start, _end, _type, _setup, _smch) \
        static const rt_svc_desc_t __svc_desc_ ## _name \
                __attribute__ ((section("rt_svc_descs"), used)) = { \
-                       _start, \
-                       _end, \
-                       _type, \
-                       #_name, \
-                       _setup, \
-                       _smch }
+                       .start_oen = _start, \
+                       .end_oen = _end, \
+                       .call_type = _type, \
+                       .name = #_name, \
+                       .init = _setup, \
+                       .handle = _smch }
 
 /*
  * Compile time assertions related to the 'rt_svc_desc' structure to: